import { request } from '@ruifox-cms/utils'

// 获取策略列表
export function getResourceAuthGroupList(params) {
    return request({
        url: '/build/api/resourceAuthGroup/selectList',
        method: 'get',
        params
    })
}

// 添加策略
export function insertResourceAuthGroup(data) {
    return request({
        url: '/build/api/resourceAuthGroup/insert',
        method: 'post',
        data
    })
}
//修改策略
export function updateResourceAuthGroup(data) {
    return request({
        url: '/build/api/resourceAuthGroup/update',
        method: 'post',
        data
    })
}
//删除策略
export function deleteResourceAuthGroup(data) {
    return request({
        url: '/build/api/resourceAuthGroup/delete',
        method: 'post',
        data
    })
}

//根据策略id获取资源权限
export function getResourceAuth(params) {
    return request({
        url: '/build/api/resourceAuth/selectList',
        method: 'get',
        params
    })
}
//策略绑定资源权限
export function bindResourceAuthGroup(data) {
    return request({
        url: '/build/api/resourceAuthGroup/bind',
        method: 'post',
        data
    })
}
//用户绑定策略
export function bindUserResourceAuthGroup(data) {
    return request({
        url: '/build/api/resourceAuthGroup/bindUser',
        method: 'post',
        data
    })
}
//获取用户策略
export function getUserResourceAuthGroup(params) {
    return request({
        url: '/build/api/resourceAuthGroup/selectSelf',
        method: 'get',
        params
    })
}
//根据用户id查询资源组权限
export function selectResourceAuthByUserId(params) {
    return request({
        url: '/build/api/resourceAuth/selectSelfByAuthGroupId',
        method: 'get',
        params
    })
}
//获取用户绑定的资源权限
export function getUserResourceAuth(params) {
    return request({
        url: '/build/api/resourceAuth/selectSelf',
        method: 'get',
        params
    })
}
//用户绑定资源权限
export function bindUserResourceAuth(data) {
    return request({
        url: '/build/api/resourceAuth/bindResourceAuth',
        method: 'post',
        data
    })
}
// 获取所有栏目
export function getAllCategory(params) {
    return request({
        url: '/build/api/category/selectList',
        method: 'get',
        params
    })
}
// 获取站点列表
export function getWebStation(data) {
    return request({
        url: '/build/api/site/selectAll',
        method: 'post',
        data
    })
}
// 获取权限列表
export function getAuthList(params) {
    return request({
        url: '/build/api/auth/selectAll',
        method: 'get',
        params
    })
}
// 添加权限
export function insertAuth(data) {
    return request({
        url: '/build/api/auth/insert',
        method: 'post',
        data
    })
}
// 修改权限
export function updateAuth(data) {
    return request({
        url: '/build/api/auth/update',
        method: 'post',
        data
    })
}
// 删除权限
export function deleteAuth(data) {
    return request({
        url: '/build/api/auth/delete',
        method: 'post',
        data
    })
}

